package com.linlei.bluetoothchat;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.ListView;

import com.linlei.bluetoothchat.common.BaseActivity;

import java.util.ArrayList;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by LinLei on 2015/3/21
 */
public class ChatActivity extends BaseActivity {

    ChatListAdapter mAdapter;
    @InjectView(R.id.list_chat_content)
    ListView in;
    @InjectView(R.id.toolbar)
    Toolbar toolbar;
    private ArrayList<SiriListItem> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);
        ButterKnife.inject(this);
        initToolbar(toolbar);

        list = getData();
        mAdapter = new ChatListAdapter(this, list);
        in.setAdapter(mAdapter);
    }

    private ArrayList<SiriListItem> getData() {
        ArrayList<SiriListItem> list = new ArrayList<SiriListItem>();
        SiriListItem siriListItem1 = new SiriListItem("啦啦", false);
        SiriListItem siriListItem2 = new SiriListItem("reca", true);
        list.add(siriListItem1);
        list.add(siriListItem2);
        return list;
    }

    class SiriListItem {
        String message;
        boolean isSiri;

        public SiriListItem(String msg, boolean siri) {
            message = msg;
            isSiri = siri;
        }
    }
}
